package com.ruoyi.app.controller;

import java.util.List;

import com.ruoyi.system.model.domain.AccountPersonalDetails;
import com.ruoyi.system.model.service.IAccountPersonalDetailsService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 游戏账号审核包赔个人详情Controller
 * 
 * @author ruoyi
 * @date 2022-05-08
 */
@RestController
@RequestMapping("/account/details")
public class AccountPersonalDetailsController extends BaseController
{
    @Autowired
    private IAccountPersonalDetailsService accountPersonalDetailsService;

    /**
     * 查询游戏账号审核包赔个人详情列表
     */
    @PreAuthorize("@ss.hasPermi('account:details:list')")
    @GetMapping("/list")
    public TableDataInfo list(AccountPersonalDetails accountPersonalDetails)
    {
        startPage();
        List<AccountPersonalDetails> list = accountPersonalDetailsService.selectAccountPersonalDetailsList(accountPersonalDetails);
        return getDataTable(list);
    }

    /**
     * 导出游戏账号审核包赔个人详情列表
     */
    @PreAuthorize("@ss.hasPermi('account:details:export')")
    @Log(title = "游戏账号审核包赔个人详情", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(AccountPersonalDetails accountPersonalDetails)
    {
        List<AccountPersonalDetails> list = accountPersonalDetailsService.selectAccountPersonalDetailsList(accountPersonalDetails);
        ExcelUtil<AccountPersonalDetails> util = new ExcelUtil<AccountPersonalDetails>(AccountPersonalDetails.class);
        return util.exportExcel(list, "游戏账号审核包赔个人详情数据");
    }

    /**
     * 获取游戏账号审核包赔个人详情详细信息
     */
    @PreAuthorize("@ss.hasPermi('account:details:query')")
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(accountPersonalDetailsService.selectAccountPersonalDetailsById(id));
    }

    /**
     * 新增游戏账号审核包赔个人详情
     */
    @Log(title = "游戏账号审核包赔个人详情", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody AccountPersonalDetails accountPersonalDetails)
    {
        return toAjax(accountPersonalDetailsService.insertAccountPersonalDetails(accountPersonalDetails));
    }

    /**
     * 修改游戏账号审核包赔个人详情
     */
    @PreAuthorize("@ss.hasPermi('account:details:edit')")
    @Log(title = "游戏账号审核包赔个人详情", businessType = BusinessType.UPDATE)
    @PutMapping("/edit")
    public AjaxResult edit(@RequestBody AccountPersonalDetails accountPersonalDetails)
    {
        return toAjax(accountPersonalDetailsService.updateAccountPersonalDetails(accountPersonalDetails));
    }

    /**
     * 删除游戏账号审核包赔个人详情
     */
    @PreAuthorize("@ss.hasPermi('account:details:remove')")
    @Log(title = "游戏账号审核包赔个人详情", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(accountPersonalDetailsService.deleteAccountPersonalDetailsByIds(ids));
    }
}
